package com.jindi.appuser.common;

import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * User: duanj
 * Date: 2017-11-29
 * Time: 14:31
 * Description:
 */
public class RandomString {
    public static String getRandomString(int length){
        //可能出现的字符
        String str="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
        Random random=new Random();
        StringBuffer sb=new StringBuffer();
        for(int i=0;i<length;i++){
            int number=random.nextInt(36);
            sb.append(str.charAt(number));
        }
        return sb.toString();
    }
    public static int getRandNum(int min, int max) {
        int randNum = min + (int)(Math.random() * ((max - min) + 1));
        return randNum;
    }

}
